<%--
Created by IntelliJ IDEA.
User: southwind
Date: 2020-02-08
Time: 15:25
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>Title</title>
    <script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
    <script type="text/javascript">
        $(function () {
            let user = {
                id: 1,
                name: "张三"
            };
            $.ajax({
                url: "/hello/jsonType",
                data: JSON.stringify(user),
                type: "POST",
                contentType: "application/x-www-form-urlencoded",
                dataType: "json",
                success: function (data) {
                    console.log(data);
                    alert(data.id)
                    alert(data.name)
                }
            })
        })
    </script>
</head>
<body>
</body>
</html>